SUBROUTINE CHECKBOX2
     *Display a simple form with one group of checkboxes,
     *each box with its own unique name

     *Include the RealWeb definitions
     INCLUDE #RW.INCLUDE.DEFS FROM /SYSFILES/REALWEB,BP

     * Get the URL of the Reality item server
     STYLESHEET = ""
     CALL RW_GET_PARAM("__isurl", STYLESHEET)
     * Specify the location of the stylesheet
     STYLESHEET = STYLESHEET : "/REALWEB-ITEMS/jstyles.css"

     * Start the HTML page
     * Display the text 'Form with Checkboxes' in the browser's title bar
     * Use the styles stylesheet
     CALL RW_START_HTML_PAGE("Form with Checkboxes", "", STYLESHEET, "", "")

     *Start the HTML form, specifying that the subroutine RESPONSE2 should be run when the submit button is clicked
     CALL RW_START_HTML_FORM("RESPONSE2","FORM6","")

     CALL RW_PUT("Please enter your surname and membership number in the boxes")
     CALL RW_NEWLINE

     *Set up LEG_CLASS to specify format of legend
     LEG_CLASS="legend"
     LEG_CLASS<2>="right"

     *Start the group of fields
     CALL RW_START_FIELDSET("")
     BUF="Member Details"
     CALL RWS_LEGEND(BUF,LEG_CLASS)
     CALL RW_PUT(BUF)
     CALL RW_PUT("Surname ")
     CALL RW_EDIT_BOX("NAME",30,"")
     CALL RW_NEWLINE
     CALL RW_PUT("Membership Number:")
     CALL RW_EDIT_BOX("NAME",9,"")
     CALL RW_NEWLINES(2)
     *Complete the group
     CALL RW_END_FIELDSET

     CALL RW_NEWLINES(2)
     CALL RW_PUT("Now check which options you require")
     CALL RW_NEWLINE

     *Create the checkboxes
     CALL RW_CHECKBOX("edchoice","Yes",0,0,"")
     CALL RW_PUT("Order the Editor's Choice")
     CALL RW_NEWLINE
     CALL RW_CHECKBOX("events","Yes",0,0,"")
     CALL RW_PUT("Request Details of Forthcoming Events")
     CALL RW_NEWLINE
     CALL RW_CHECKBOX("balance","Yes",0,0,"")
     CALL RW_PUT("View the Balance of My Account")
     CALL RW_NEWLINE
     CALL RW_CHECKBOX("payment","Yes",0,0,"")
     CALL RW_PUT("Pay for Recent Orders")
     CALL RW_NEWLINES(2)
     
     *Create the submit button
     CALL RW_SUBMIT_BUTTON("Submit Details","")

     *Complete the form
     CALL RW_END_FORM

     * Complete the page
     CALL RW_END_PAGE
RETURN
SUBROUTINE RESPONSE2
     *Display message acknowledging requested options to user submitting Form 6

     * Include the RealWeb definitions
     INCLUDE #RW.INCLUDE.DEFS FROM /SYSFILES/REALWEB,BP

     * Start the HTML page
     * Display the text 'Response to Form' in the browser's title bar
     CALL RW_START_HTML_PAGE("Response to Form", "", "", "", "")

     CALL RW_PUT("Thankyou for your selections")
     CALL RW_NEWLINE

     *Get the value of "edchoice" from Form 6
     CALL RW_GET_PARAM("edchoice",EDCHOICE)
     *Get the value of "events" from Form 6
     CALL RW_GET_PARAM("events",EVENTS)
     *Get the value of "balance" from Form 6
     CALL RW_GET_PARAM("balance",BALANCE)
     *Get the value of "payment" from Form 6
     CALL RW_GET_PARAM("payment",PAYMENT)

     IF EDCHOICE = "Yes" THEN
          CALL RW_NEWLINE
          CALL RW_PUT("The Editor's Choice will be dispatched immediately")
     END

     IF EVENTS = "Yes" THEN
          CALL RW_NEWLINE
          CALL RW_PUT("Details of forthcoming events will be sent to you immediately")
     END

     IF BALANCE = "Yes" THEN
          CALL RW_NEWLINE
          CALL RW_PUT("You are being transferred to the Accounts System. Your balance will be displayed shortly.")
     END

     IF PAYMENT = "Yes" THEN
          CALL RW_NEWLINE
          CALL RW_PUT("You are being transferred to the Accounts System for entry of credit card details")
     END

     * Complete the page
     CALL RW_END_PAGE
RETURN

Go to top button